import { http as request } from '@/http/http'

// 应急物资管理->物资分类 VO
export interface ResMaterialCategoryVO {
  id: number // 分类ID
  parentId: number // 父分类ID
  categoryCode: string // 分类编码
  categoryName: string // 分类名称
  emergencyLevel: boolean // 应急等级 (1-核心物资 2-重要物资 3-一般物资)
  isSpecialManagement: boolean // 是否特殊管控
  storageRequirement: string // 特殊存储要求
  inspectionCycle: number // 抽检周期(天)
  sortOrder: number // 排序权重
  remark: string // 备注
}

// 应急物资管理->物资分类 API
export const ResMaterialCategoryApi = {
  // 查询应急物资管理->物资分类分页
  getResMaterialCategoryPage: async (params: any) => {
    return await request.get(`/wms/res-material-category/page`, params)
  },
  getResMaterialCategoryList: async () => {
    return await request.get(`/wms/res-material-category/simple-list`)
  },
  // 查询应急物资管理->物资分类详情
  getResMaterialCategory: async (id: number) => {
    return await request.get(`/wms/res-material-category/get?id=${id}`)
  },

  // 新增应急物资管理->物资分类
  createResMaterialCategory: async (data: ResMaterialCategoryVO) => {
    return await request.post(`/wms/res-material-category/create`, data)
  },

  // 修改应急物资管理->物资分类
  updateResMaterialCategory: async (data: ResMaterialCategoryVO) => {
    return await request.put(`/wms/res-material-category/update`, data)
  },

  // 删除应急物资管理->物资分类
  deleteResMaterialCategory: async (id: number) => {
    return await request.delete(`/wms/res-material-category/delete?id=${id}`)
  },

  // 导出应急物资管理->物资分类 Excel
  // exportResMaterialCategory: async (params) => {
  //   return await request.download(  `/wms/res-material-category/export-excel`, params )
  // },
}
